package com.tandashi.springbootstudy01.study.proxy;

import java.lang.reflect.Proxy;

public class Main {

    public static void main(String[] args) {
        Service service = new ServiceImpl();
        LogHandler handler = new LogHandler(service);
        Object o = Proxy.newProxyInstance(Main.class.getClassLoader(), new Class[]{Service.class}, handler);
        Service service1 = (Service)o;
        service1.log("hello proxy");
    }
}
